<!--  -->
<template>
  <div>
    <van-nav-bar :title="activityname" left-text="返回" left-arrow @click-left="onClickLeft" />
    <div v-if="checkedresult.length!=0">
      <van-notice-bar color="#1989fa" background="#ecf9ff" left-icon="info-o" style="margin-bottom:10px"
        class="noticebox">
        当前已选择<span class="redcolor">{{userchoosecount}}</span>项，最少<span class="redcolor">1</span>项，最多<span
          class="redcolor">{{votemax}}</span>项
      </van-notice-bar>
      <van-card price="2.00" desc="描述信息" currency="" :title="item"
        thumb="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fbpic.588ku.com%2Fback_origin_min_pic%2F20%2F04%2F16%2F8cc351a381653918fc5c24194323fe25.jpg%21%2Ffw%2F750%2Fquality%2F99%2Funsharp%2Ftrue%2Fcompress%2Ftrue&refer=http%3A%2F%2Fbpic.588ku.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1639017153&t=53bf269efbd1404c40acbb599d250c75"
        v-for="(item,index) in checkedresult" :key="index">
        <template #footer>
          <van-button size="mini">删除</van-button>
        </template>
      </van-card>
      <van-row>
        <van-col span="12">
          <van-button icon="delete-o" type="info" plain style="width:100%">
            清空
          </van-button>
        </van-col>
        <van-col span="12">
          <van-button icon="good-job-o" type="danger" style="width:100%">确认投票</van-button>
        </van-col>
      </van-row>
    </div>
    <div v-else>
      <van-empty description="您还没有选择喔~" />
    </div>

  </div>
</template>

<script>
  export default {
    data() {
      return {
        activityname: "",
        checkedresult: [],
        votemax: 10
      };
    },
    created() {
      this.activityname = this.$store.state.title
      this.checkedresult = this.$route.query.checkedresult
      console.log(this.$route.query)
    },
    components: {},

    computed: {
      userchoosecount() {
        return this.checkedresult.length
      }
    },

    mounted: {},

    methods: {
      onClickLeft() {
        this.$router.push({
          path: "/vote"
        })
      },
    }
  }
</script>
<style scoped lang="less">
  .van-card__content {
    text-align: left;
  }

  .redcolor {
    color: #ee0a24;
    margin: 0 3px;
    font-weight: bold;
  }

  .van-card__title {
    font-size: 20px;
    line-height: 30px;
  }
</style>